package com.cheryjb.examples.spring.transactions.managers;

import java.util.List;

import com.cheryjb.examples.spring.transactions.model.Person;

/**
 * used as a CRUD manager for the Domain Object Person
 * 
 * @author cheryjb
 * 
 */
public interface PersonManager {

	/**
	 * remove all the persons from the repository
	 */
	void clearAll();

	/**
	 * add a person in the repository
	 * 
	 * @param person
	 *            The person to add
	 */
	void addPerson(Person person);

	/**
	 * retrieve a person from the repository
	 * 
	 * @param id
	 *            Unique ID used to identify the person to retrieve
	 * @return the person identified by the <tag>id</tag>
	 */
	Person getPerson(String id);

	/**
	 * retrieve a list of persons from the repository
	 * 
	 * @param ids
	 *            Unique IDs used to identify the persons to retrieve
	 * @return the persons identified by <tag>ids</tag>
	 */
	List<Person> getPersons(String[] ids);

	/**
	 * perform an operation (abstract concept) on a person.
	 * 
	 * @param person
	 *            the person on which the operation is done
	 */
	void doOperation(Person person);

	/**
	 * perform an operation (abstract concept) on each person in the list.
	 * 
	 * @param persons
	 *            the persons on which the operation is done
	 */
	void doOperation(List<Person> persons);
	
	/**
	 * drop table Person
	 */
	void dropRepository();
	
	/**
	 * create table Person
	 */
	void createRepository();

}
